package com.ssy.lingxi.message.entity;


import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 推送设备实体类
 * @author yzc
 * @version 2.0.0
 * @date 2020/10/26
 */
@Data
@Entity
@Table(schema = "public", name = "msg_push_device",
        indexes = {@Index(name = "msg_push_device_registrationId_id_idx", columnList = "registrationId", unique = true),
                @Index(name = "msg_push_device_member_id_idx", columnList = "memberId"),
                @Index(name = "msg_push_device_role_id_idx", columnList = "roleId")})
public class PushDevice implements Serializable {

    private static final long serialVersionUID = -8766741583686050860L;

    /**
     * 主键id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "push_device_seq")
    @SequenceGenerator(sequenceName = "msg_push_device_seq", name = "push_device_seq", allocationSize = 1)
    private Long id;

    /**
     * 会员id
     */
    @Column
    private Long memberId;

    /**
     * 角色id
     */
    @Column
    private Long roleId;

    /**
     * 用户id
     */
    @Column
    private Long userId;

    /**
     * 设备唯一id
     */
    @Column
    private String registrationId;

    /**
     * 创建时间
     */
    @Column
    private Long createTime;
}
